<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->comment("标题");
            $table->text("content")->comment("内容");
            $table->integer("uid")->default("-1")->comment("发布人，-1表示后台管理员发布");
            $table->integer('status')->default(2)->comment("状态，1审核中，2通过，-1拒绝。暂时只有后台发布，则默认为2");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
